package com.ce.pms.log4ce;

import java.util.Map;

import org.aspectj.lang.JoinPoint;

import com.ce.component.log4ce.aop.constructor.support.AbstractBizDescriptionHandler;
import com.ce.component.log4ce.aop.constructor.support.OriginalObjectHolder;
import com.ce.component.log4ce.aop.parser.BizLogParser;
import com.ce.pms.customer.vo.IndividualVO;
import com.ce.pms.house.vo.HouseVO;

public class MemberDeleteHandler  extends AbstractBizDescriptionHandler
{
	private Log4ceHelper log4ceHelper = Log4ceHelper.getInstance();
	public Map<String, Object> getNamedParametersMap(JoinPoint joinpoint, Object returnValue, BizLogParser bizlogparser)
	{
		Map<String,Object> map = bizlogparser.getLogArguments(joinpoint);

		Long ownerId = (Long)map.get("ownerId");
		String customerName = log4ceHelper.getCustomerName(ownerId);

		Map<String, Object> holderInfoMap = OriginalObjectHolder.ORIGINAL_OBJECTS.get();
		IndividualVO memberInfo = (IndividualVO)holderInfoMap.get("memberInfo");
		HouseVO houseInfo = (HouseVO)holderInfoMap.get("houseInfo");

		map.put("customerName", customerName);
		map.put("houseNumber", houseInfo.getHouseNumber());
		map.put("participantName", memberInfo.getParticipantName());
		map.put("ID_type", memberInfo.getCertificateTypeName());
		map.put("idNumber", memberInfo.getCertificateNo());
		map.put("telephone", memberInfo.getTelephone());

		map.putAll(bizlogparser.getLogStaticContents(joinpoint));
		return map;
	}
}
